package pkmn.attributes;

import pkmn.nature.Nature;

public class Attributes{

    public double attack;
    public double defense;
    public double spAttack;
    public double spDefense;
    public double speed;

    /**
     * Constructor
     * @param attack int
     * @param defense int
     * @param spAttack int
     * @param spDefense int
     * @param speed int
     */
    public Attributes(double attack, double defense, double spAttack, double spDefense, double speed){
        this.attack = attack;
        this.defense = defense;
        this.spAttack = spAttack;
        this.spDefense = spDefense;
        this.speed = speed;
    }

    /**
     * Apply Nature bonus
     * @param nature Nature
     */
    public void adjustByNature(Nature nature){
        this.attack += this.attack * Nature.attackBonus(nature) / 100;
        this.defense += this.defense * Nature.defenseBonus(nature) / 100;
        this.speed += this.speed * Nature.defenseBonus(nature) / 100;
        this.spAttack += this.spAttack * Nature.attackBonus(nature) / 100;
        this.spDefense += this.spDefense * Nature.defenseBonus(nature) / 100;
    }

    /**
     * Get a description of attributes
     * @return String
     */
    @Override
    public String toString() {
        return "-Attack: " + Integer.toString((int)this.attack)
               + "\n-Deffense: " + Integer.toString((int)this.defense)
               + "\n-Sp. Attack: " + Integer.toString((int)this.spAttack)
               + "\n-Sp. Deffense: " + Integer.toString((int)this.spDefense)
               + "\n-Speed: " + Integer.toString((int)this.speed);
    }
}
